#ifndef TRAYMENU_H
#define TRAYMENU_H

#include <QMenu>
#include <QDir>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QTimerEvent>


#include "mainwindow.h"
#include "managewindow.h"

class TrayMenu : public QMenu
{
    Q_OBJECT

public:
    explicit TrayMenu(QWidget *parent = nullptr);

signals:
    void showWindow();

private:
#if 0
    QAction *pHomePageAction;
    QAction *pHelpAction;
    QAction *pAboutAction;
    QAction *pUpgradeAction;
#endif
    QAction *pManageAction;
    QAction *pQuitAction;
    QList <MainWindow *> mws;
    QJsonArray confJsonArray;
    QFile *confJsonFile;
    ManageWindow *manageWindow;

    void newConfigJson();
    void loadConfigJson();
    void createDataDir();
    void newNoteConf(int xPos, int yPos);

private slots:
	void on_pQuitAction_triggered();
    void on_pManageAction_triggered();
    void on_mws_newWindow();
    void on_mws_closeWindow();

    void timerEvent(QTimerEvent *event);
};


#endif // TRAYMENU_H
